package com.mzy.model;

import javax.validation.constraints.Min;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author mzy
 * @Date 2022/1/9 22:59
 * @Version 1.0
 */
public class PageDTO {
    @Min(
            value = 1L,
            message = "页码不能小于1"
    )
    private int pageNum = 1;
    @Min(
            value = 1L,
            message = "页数不能小于1"
    )
    private int pageSize = 10;
    private static final int maxPageSize = 5000;
    private static final int defaultPageSize = 10;

    public int getPageNum() {
        return this.pageNum;
    }

    public void setPageNum(int pageNum) {
        this.pageNum = pageNum;
    }

    public int getPageSize() {
        return this.pageSize;
    }

    public void setPageSize(int pageSize) {
        if (pageSize > 5000) {
            this.pageSize = 10;
        } else {
            this.pageSize = pageSize;
        }

    }
}
